<?php

//Person
class Form_Person_Query extends Base_Form
{
    public function init()
    {
		$this->addElements(array(
            new Zend_Form_Element_Select('street', array(
                'required'   => false,
                'label'      => 'Street:',
                'multiOptions' => array(
                    ''       => 'Select',
                ),
                'filters'    => array('StringTrim'),
				'decorators' =>array(
					'ViewHelper', 'Label', 'Errors',
				),
            )),
            new Zend_Form_Element_Select('village', array(
                'required'   => false,
                'label'      => 'Village:',
                'multiOptions' => array(
                    ''       => 'Select',
                ),
                'filters'    => array('StringTrim'),
				'decorators' =>array(
					'ViewHelper', 'Label', 'Errors',
				),
            )),
            new Zend_Form_Element_Select('gender', array(
                'required'   => false,
                'label'      => 'Gender:',
                'multiOptions' => array(
                    ''       => 'Select',
                    'Male'   => 'Male',
                    'Female' => 'Female',
                ),
                'filters'    => array('StringTrim'),
				'decorators' =>array(
					'ViewHelper', 'Label', 'Errors',
				),
                'validators' => array(
                    array('InArray', false, array(array(
						'Male','Female'
						)
					))
                )
            )),
			// Add an hidden element
            new Zend_Form_Element_Text('fid', array(
                'required'   => false,
                'label'      => 'Fid:',
				'decorators' =>array(
					'ViewHelper', 'Label', 'Errors',
				),
                'validators' => array(
					array('validator' => 'StringLength', 'options' => array(12,12))
                )
            )),
			// Add an username element
            new Zend_Form_Element_Text('name', array(
                'required'   => false,
                'label'      => 'Name:',
                'filters'    => array('StringTrim'),
				'decorators' =>array(
					'ViewHelper', 'Label', 'Errors',
				),
                'validators' => array(
					array('validator' => 'StringLength', 'options' => array(4,30))
                )
            )),
            new Zend_Form_Element_Select('gender', array(
                'required'   => false,
                'label'      => 'Gender:',
                'multiOptions' => array(
                    ''       => 'Select',
                    'Male'   => 'Male',
                    'Female' => 'Female',
                ),
                'filters'    => array('StringTrim'),
				'decorators' =>array(
					'ViewHelper', 'Label', 'Errors',
				),
                'validators' => array(
                    array('InArray', false, array(array(
						'Male','Female'
						)
					))
                )
            )),
            new Zend_Form_Element_Select('national', array(
                'required'   => false,
                'label'      => 'National:',
                'multiOptions' => array(
                    '' => 'Select',
                    'Han' => 'Han',
                    'Mongolian' => 'Mongolian',
                    'Yi' => 'Yi',
                    'Dong' => 'Dong',
                    'Kazak' => 'Kazak',
                    'She' => 'She',
                    'Naxi' => 'Naxi',
                    'Mulao' => 'Mulao',
                    'Gelao' => 'Gelao',
                    'Nu' => 'Nu',
                    'Bonan' => 'Bonan',
                    'Oroqen' => 'Oroqen',
                    'Hui' => 'Hui',
                    'Zhuang' => 'Zhuang',
                    'Yao' => 'Yao',
                    'Dai' => 'Dai',
                    'Gaoshan' => 'Gaoshan',
                    'Jingpo' => 'Jingpo',
                    'Qiang' => 'Qiang',
                    'Xibe' => 'Xibe',
                    'Ozbek' => 'Ozbek',
                    'Yugur' => 'Yugur',
                    'Hoche' => 'Hoche',
                    'Tibetan' => 'Tibetan',
                    'Buyi' => 'Buyi',
                    'Bai nationality' => 'Bai nationality',
                    'Li' => 'Li',
                    'Lahu' => 'Lahu',
                    'Kirgiz' => 'Kirgiz',
                    'Blang' => 'Blang',
                    'Achang' => 'Achang',
                    'Russians' => 'Russians',
                    'Jing' => 'Jing',
                    'Monba' => 'Monba',
                    'Uighur' => 'Uighur',
                    'Korean' => 'Korean',
                    'Tujia' => 'Tujia',
                    'Lisu' => 'Lisu',
                    'Aquarium' => 'Aquarium',
                    'Tu' => 'Tu',
                    'Salar' => 'Salar',
                    'Pumi' => 'Pumi',
                    'Ewenki' => 'Ewenki',
                    'Tatar' => 'Tatar',
                    'Lhoba' => 'Lhoba',
                    'Miao' => 'Miao',
                    'Manchu' => 'Manchu',
                    'Hani' => 'Hani',
                    'Wa' => 'Wa',
                    'Dongxiang' => 'Dongxiang',
                    'Daur' => 'Daur',
                    'Maonan' => 'Maonan',
                    'Tajik' => 'Tajik',
                    'Deang' => 'Deang',
                    'Dulong' => 'Dulong',
                    'Jino' => 'Jino',
                    'Other' => 'Other',
                ),
                'filters'    => array('StringTrim'),
				'decorators' =>array(
					'ViewHelper', 'Label', 'Errors',
				),
                'validators' => array(
                    array('InArray', false, array(array(
						'Han','Mongolian','Yi','Dong','Kazak','She','Naxi','Mulao','Gelao','Nu','Bonan','Oroqen','Hui','Zhuang','Yao','Dai','Gaoshan','Jingpo','Qiang','Xibe','Ozbek','Yugur','Hoche','Tibetan','Buyi','Bai nationality','Li','Lahu','Kirgiz','Blang','Achang','Russians','Jing','Monba','Uighur','Korean','Tujia','Lisu','Aquarium','Tu','Salar','Pumi','Ewenki','Tatar','Lhoba','Miao','Manchu','Hani','Wa','Dongxiang','Daur','Maonan','Tajik','Deang','Dulong','Jino','Other'
						)
					))
                )
            )),
			// Add an username element
            new Zend_Form_Element_Text('id_number', array(
                'required'   => false,
                'label'      => 'Id number:',
                'filters'    => array('StringTrim'),
				'decorators' =>array(
					'ViewHelper', 'Label', 'Errors',
				),
                'validators' => array(
					array('validator' => 'StringLength', 'options' => array(4,30))
                )
            )),
            new Zend_Form_Element_Select('marital_status', array(
                'required'   => false,
                'label'      => 'Marital status:',
                'multiOptions' => array(
                    ''       => 'Select',
                    'Unmarried'  => 'Unmarried',
                    'First'  => 'First',
                    'Remarry'  => 'Remarry',
                    'Divorce'  => 'Divorce',
                    'Widowed'  => 'Widowed',
                ),
                'filters'    => array('StringTrim'),
				'decorators' =>array(
					'ViewHelper', 'Label', 'Errors',
				),
                'validators' => array(
                    array('InArray', false, array(array(
						'Unmarried','First','Remarry','Divorce','Widowed'
						)
					))
                )
            )),
            new Zend_Form_Element_Select('education', array(
                'required'   => false,
                'label'      => 'Education:',
                'multiOptions' => array(
                    ''       => 'Select',
                    'Primary School'  => 'Primary School',
                    'Junior high school'  => 'Junior high school',
                    'High School'  => 'High School',
                    'Secondary technical schools'  => 'Secondary technical schools',
                    'Technical School'  => 'Technical School',
                    'Undergraduate'  => 'Undergraduate',
                    'University and above'  => 'University and above',
                    'University College and College'  => 'University College and College',
                    'Other'  => 'Other',
                ),
                'filters'    => array('StringTrim'),
				'decorators' =>array(
					'ViewHelper', 'Label', 'Errors',
				),
                'validators' => array(
                    array('InArray', false, array(array(
						'Primary School',
						'Junior high school',
						'High School',
						'Secondary technical schools',
						'Technical School',
						'Undergraduate',
						'University and above',
						'University College and College',
						'Other'
						)
					))
                )
            )),
            new Zend_Form_Element_Select('account_nature', array(
                'required'   => false,
                'label'      => 'Account nature:',
                'multiOptions' => array(
                    ''       => 'Select',
                    'Agriculture'  => 'Agriculture',
                    'Non-agricultural'  => 'Non-agricultural',
                ),
                'filters'    => array('StringTrim'),
				'decorators' =>array(
					'ViewHelper', 'Label', 'Errors',
				),
                'validators' => array(
                    array('InArray', false, array(array(
						'Agriculture','Non-agricultural'
						)
					))
                )
            )),
        ));

        $this->addDisplayGroup(
            array('street','village','fid','name','gender','national','id_number','marital_status','education','account_nature','account_status'), 'person',
			array(
				'legend' => 'Person'
			)
		);
    }
}
